<?php
namespace WXAPI\Controller;
use Think\Controller;

class DistributController extends BaseController {

    /**
     * 析构流函数
     */
    public function  __construct() {   
        parent::__construct();    
    
    } 
    
    public function _initialize(){
        parent::_initialize();
       
    }
    
    /**
     * 获取分销条件
     */
    public function condition(){
        $condition =  M('config')->where(array("name"=>'condition'))->getField('value');
        $user_id = I('user_id'); 
        if($user_id){
            $is_distribut = M('users')->where(array('user_id'=>$user_id))->getField('is_distribut');
        }

        $data = array(
            'condition'=>$condition,
            'is_distribut'=>$is_distribut
        );
        $json_arr = array('status'=>1,'msg'=>'成功!','result'=>$data);
        $json_str = json_encode($json_arr);
        exit($json_str);
    }
    
    
    
}